﻿<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>首页</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta content="锐车" name="keywords" />
	<meta content="锐车" name="description" />
	<link rel="stylesheet" href="/static/layui/css/layui.css">
	<link rel="stylesheet" href="/static/home/Css/swiper.min.css">
	<link rel="stylesheet" type="text/css" href="/static/home/Css/style.css">
	<script type="text/javascript" src="/static/home/Scripts/jquery.js"></script>
	<script type="text/javascript" src="/static/layui/layui.js"></script>
	<script type="text/javascript" src="/static/home/Scripts/common.js"></script>
	<script type="text/javascript" src="/static/home/Scripts/swiper.min.js"></script>
	<script type="text/javascript">
		$(function () {
			//搜索
			$('#search').click(function () {
				var keyword = $("input[name=k]").val();
				location.href = "{:url('home/home/buycar')}?keyword="+keyword;
			});

			$("body").keydown(function(event) {
				if (event.keyCode == "13") {
					$('#search').click();
				}
			});

			$(".indexbrand").hover(
				function () {
					$(".rightj").hide();
					$(this).parent().parent().addClass("active");
					$(this).children('.active-box').show();
				},
				 function () {
					$(".rightj").show();
					$(this).parent().parent().removeClass("active");
					$(this).children('.active-box').hide();
				}
			);
		});
	</script>
  </head>
<body>
	<script language="JavaScript">
$(function(){
	$(".nav_all_types").hover(function(){
		$(".show_all_types .layui-icon").html("&#xe619;");
		$(".all_types_box").show();
	},function(){
		$(".show_all_types .layui-icon").html("&#xe61a;");
		$(".all_types_box").hide();
	});

	//城市选择
	$(".citymark a").click(function() {
		var mark = $(this).attr("dataid");
		var citytop = $(".city-list").scrollTop()+$("#"+mark).position().top - 50;
		$(".city-list").animate({
			scrollTop: citytop
		}, {duration: 500, easing: "swing"});
		return false;
	});

	$(".selectcity").click(function(event) {
		if($(".citylist-box").is(":hidden")){
			$(this).addClass("whitebg");
			$(".selectcity .layui-icon").html("&#xe619;");
			$(".citylist-box").removeClass("layui-hide");
		}
		else{
			$(this).removeClass("whitebg");
			$(".selectcity .layui-icon").html("&#xe61a;");
			$(".citylist-box").addClass("layui-hide");
		}
		event.stopPropagation();//这句是必须
	});


	$(document).bind("click",function(e){
		var target  = $(e.target);
		if(target.closest(".citylist-box").length == 0){
			$('.selectcity').removeClass("whitebg");
			$(".selectcity .layui-icon").html("&#xe61a;");
			$(".citylist-box").addClass("layui-hide");
		}
		e.stopPropagation();
	});

	$(".changecity").click(function() {
		var city = $(this).attr("data");
		$.ajax({
			url: "/index.php?m=ajax&ajax=1&changecity=1",
			data:{city:city},
			type: "get",
			dataType: "json",
			success: function(data){
				if(data.status == 'y'){
					window.location.reload();
				}
			}
		});
	});
})
</script>
{include file="public/head"/}
	<!--幻灯片-->
	<div class="flimbox">

		<div class="swiper-container">
			<div class="swiper-wrapper">
				<div class="swiper-slide">
					{foreach $img as $vi}
					<div style="background: url({$vi['address']}) no-repeat center center;background-size:100% 500px;height:500px;width:100%;">
						<a href="http://www.baidu.com" style="display:block;width:100%;height:500px;"></a>
					</div>
					{/foreach}
					</div>
				</div>
			<div class="swiper-pagination"></div>
		</div>
		<script>        
			var mySwiper = new Swiper ('.swiper-container', {
				loop: true,
				autoplay:true,
				pagination: {
					el: '.swiper-pagination',
					clickable:true,
				}
		  })        
		</script>
		<div class="topsearch">
			<div class="input-group">
			  <input type="text" name="k" class="search-keyword" placeholder="请输入感兴趣的品牌、车系"><span class="input-group-btn"><button type="submit" class="search-button" id="search"> 立即搜索</button></span>
			</div>
		</div>
	</div>
	<div class="layui-container" style="margin-top:-80px;">
		<div class="left-search">
			<div class="left-search-box layui-clear">
				<div class="left-search-box-item rightborder" style="width:45%">
					<div class="left-search-subbox">
						<div class="title indexbrand">
							<div class="s-title">品牌 <i class="layui-icon rightj">&#xe61a;</i></div>
							<div class="allbrand-box active-box">
								<div class="subCate">
									<div class="branddlistbox layui-clear">
										<div class="brandleft">
											<div class="branddlist clearfix">
												{foreach $bfirst as $v}
												<div class="sign">{$v['first']}</div>
												<div class="brand">
													{foreach $brand as $v1}
													{if $v1['first']==$v['first']}
													<a href="{:url('home/home/buycar')}?bname={$v1['bname']}">{$v1['bname']}</a>
													{/if}
													{/foreach}
												</div>
												{/foreach}
											</div>
										</div>
									</div>
								</div>
							</div>	
						</div>
						<ul class="layui-clear">
							{foreach $brand as $v0}
							{if $v0['is_commend']==1}
							<li>
								<a href="{:url('home/home/buycar')}?bname={$v0['bname']}">
									<img src="{$v0['logo']}" width="40" style="margin-top:15px;">
								</a>
								<p style="text-align:center;"><a href="{:url('home/home/buycar')}?bname={$v0['bname']}">{$v0['bname']}</a></p>
							</li>
							{/if}
							{/foreach}
						</ul>
					</div>
				</div>
				<div class="left-search-box-item rightborder"  style="width:30%">
					<div class="left-search-subbox">
						<div class="title">级别</div>
						<ul class="layui-clear">
							{foreach $level as $v}
							<li><a href="{:url('home/home/buycar')}?lname={$v['lname']}">{$v['lname']}</a></li>
							{/foreach}
						</ul>
					</div>
				</div>
				<div class="left-search-box-item"  style="width:25%">
					<div class="left-search-subbox">
						<div class="title">价格</div>
						<ul>
							<li><a href="{:url('home/home/buycar')}?preprice=3">3万以下</a></li>
							<li><a href="{:url('home/home/buycar')}?preprice=5">5万以下</a></li>
							<li><a href="{:url('home/home/buycar')}?preprice=10">10万以下</a></li>
							<li><a href="{:url('home/home/buycar')}?preprice=20">20万以下</a></li>
							<li><a href="{:url('home/home/buycar')}?preprice=30">30万以下</a></li>
							<li><a href="{:url('home/home/buycar')}?preprice='>30">30万以上</a></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="layui-container">
		<div class="layui-row cartypebox layui-col-space20">
			<div class="layui-col-md4">
				<a href="" class="cartype car1"><p>城市SUV</p><p class="subtitle">家庭实用之选</p><div class="img"><img src="/static/home/Picture/car1.png" width="160"></div></a>
			</div>
			<div class="layui-col-md4">
				<a href="" class="cartype car2"><p>练手车</p><p class="subtitle">碰碰不心疼</p><div class="img"><img src="/static/home/Picture/car2.png" width="160"></div></a>
			</div>
			<div class="layui-col-md4">
				<a href="" class="cartype car3"><p>准新车</p><p class="subtitle">3年1万公里内</p><div class="img"><img src="/static/home/Picture/car3.png" width="160"></div></a>
			</div>
		</div>
	</div>
	<div class="layui-container">
		<div class="index-box">
			<div class="title">最新上架</div>
			<div class="layui-row layui-col-space30">
				{foreach $source as $v}
				<div class="layui-col-md3">
					<div class="carlist">
						<div class="img">
							<div class="isreport"></div>
							<a href="{:url('home/home/cardetail')}?sid={$v['sid']}" target="_blank"><img src="{$v['img']}" class="lazy"/></a>
						</div>
						<div class="caption">
							<a href="{:url('home/home/cardetail')}?sid={$v['sid']}" class="showmore">查看详情</a>
							<h4><a href="{:url('home/home/cardetail')}?sid={$v['sid']}" target="_blank">{$v['tname']}</a></h4>
							<p class="carinfo">{$v['licensetime']|date='Y-m-d'}上牌 / {$v['distance']}万公里</p>
							<p class="carprice">{$v['preprice']}万</p>
							<p class="carinfo">新车指导价：<span class="hl">{$v['newprice']}万</span></p>
						</div>
					</div>
				</div>
				{/foreach}
			</div>
		</div>
		<a class="morecars mt20" href="{:url('home/home/buycar')}">查看更多车源</a>
	</div>
	<div class="layui-container">
		<div class="index-box">
			<div class="title">推荐车源</div>
			<div class="layui-row layui-col-space30">
				{foreach $recommed as $v}
				<div class="layui-col-md3">
					<div class="carlist">
						<div class="img">
							<div class="isreport"></div>							
							<a href="{:url('home/home/cardetail')}?sid={$v['sid']}" target="_blank"><img src="{$v['img']}" class="lazy"/></a>
						</div>
						<div class="caption">
							<a href="{:url('home/home/cardetail')}?sid={$v['sid']}" class="showmore">查看详情</a>
							<h4><a href="{:url('home/home/cardetail')}?sid={$v['sid']}" target="_blank">{$v['tname']}</a></h4>
							<p class="carinfo">{$v['licensetime']|date='Y-m-d'} 上牌 / {$v['distance']}万公里</p>
							<p class="carprice">{$v['preprice']}万</p>
							<p class="carinfo">新车指导价：<span class="hl">{$v['newprice']}万</span></p>
						</div>
					</div>
				</div>
				{/foreach}
			</div>
		</div>
		<a class="morecars mt20" href="{:url('home/home/buycar')}">查看更多车源</a>
	</div>
	<div class="gray-box">
		<div class="layui-container">
			<div class="newsbox">
				<div class="title">购车宝典</div>
				<div class="layui-row layui-col-space30">
					{foreach $res as $vr}
					<div class="layui-col-md4">
						<div class="indexnewslist">
							<a href="/news/239" target="_blank">
								<div class="img"><img src="{$a}"></div>
								<div class="box">
									<h3 class="newstitle">{$vr.title}</h3>
									<div class="newsinfo">{$vr.content}</div>
								</div>
							</a>
						</div>
					</div>
					{/foreach}
				</div>
			</div>
		</div>
	</div>
	<div class="layui-container">
		<div class="index-box">
			<div class="title">友情链接</div>
			<div class="flinklist">
				{foreach $fl as $vf}
				<a href="{$vf['linkurl']}" target="_blank">{$vf.linkname}</a>
				{/foreach}
			</div>
		</div>
	</div>
		
{include file="public/foot" /}